package com.deram.ctin.serv.enter.api.impl;

import com.deram.ctin.common.bean.PageResult;
import com.deram.ctin.serv.enter.api.EnterPersonApi;
import com.deram.ctin.serv.enter.entity.BaseUpdateInfo;
import com.deram.ctin.serv.enter.entity.EnterPerson;
import com.deram.ctin.serv.enter.filter.EnterPersonFilter;
import com.deram.ctin.serv.enter.service.EnterPersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: jtt
 * @Description:
 * @Date: 2017/9/28 17:30
 * @version: V1.0
 */
@RestController
public class EnterPersonApiImpl implements EnterPersonApi {

    @Autowired
    private EnterPersonService enterPersonService;

    @Override
    public List<EnterPerson> list(@RequestBody EnterPersonFilter filter) {
        return enterPersonService.list(filter);
    }

    @Override
    public EnterPerson save(@RequestBody EnterPerson param) {
        return enterPersonService.save(param);
    }

    @Override
    public PageResult<EnterPerson> search(@RequestBody EnterPersonFilter filter, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize) {
        return enterPersonService.search(filter, pageNo, pageSize);
    }

    @Override
    public void delete(Long id) {
        enterPersonService.delete(id);
    }

    @Override
    public void saveList(@RequestBody BaseUpdateInfo<EnterPerson> updateInfo) {
        enterPersonService.saveList(updateInfo);
    }
}
